//
//  TemplateFoundDetailsModel.h
//  YuTang
//
//  Created by 葛悦彣 on 2024/7/16.
//

#import <Foundation/Foundation.h>
#import "getPondTissueListModel.h"
#import "foundQuestModel.h"

NS_ASSUME_NONNULL_BEGIN
@class TemplateFoundDetailsStepModelListModel,TemplateFoundDetailsTaskTypeModelListModel,TemplateFoundDetailsExecuteModelListModel,TemplateFoundDetailsTaskItemModelListModel,TemplateFoundDetailsChildrenModelListModel,TemplateFoundDetailsItemModelListModel,TemplateFoundDetailsItemListModel,pondModelListModel;
///最外层
@interface TemplateFoundDetailsModel : NSObject

///关联养殖场
@property (nonatomic ,strong) NSString * orgCode;
///关联养殖场id
@property (nonatomic ,strong) NSString * breedId;
///关联养殖场名称
@property (nonatomic ,strong) NSString * breedName;
///模板说明
@property (nonatomic ,strong) NSString * Description;
///主键
@property (nonatomic ,strong) NSString * ID;
///模板版本号
@property (nonatomic ,strong) NSString * version;
///公共模板id
@property (nonatomic ,strong) NSString * templateId;
///公共模板名称
@property (nonatomic ,strong) NSString * templateName;
///模板名称
@property (nonatomic ,strong) NSString * name;
///池塘类型id
@property (nonatomic ,strong) NSString * pondId;
///池塘类型名称
@property (nonatomic ,strong) NSString * pondName;
///排序
@property (nonatomic ,assign) NSInteger sort;
///模板任务步骤详情
@property (nonatomic ,strong) NSArray<TemplateFoundDetailsStepModelListModel *> * stepModelList;

@property (nonatomic ,assign) BOOL isXG;

///额外数据
///当前的是否是最后一个步骤,用来判断按钮显示文本
@property (nonatomic ,assign) BOOL isLastModel;
///选中另一个步骤
- (void)setSeledModel:(TemplateFoundDetailsStepModelListModel *)model;
///选中的model
@property (nonatomic ,strong) TemplateFoundDetailsStepModelListModel * seledModel;
///提交时的提示文本
- (NSString *)TjAPiHUDString;
///提交字典
- (NSMutableDictionary *)TjDict;
@end



///步骤
@interface TemplateFoundDetailsStepModelListModel : NSObject
///主键
@property (nonatomic ,strong) NSString * ID;
///模板步骤主键
@property (nonatomic ,strong) NSString * templateStepId;
///任务步骤
@property (nonatomic ,strong) NSString * name;
///排序
@property (nonatomic ,assign) NSInteger sort;
@property (nonatomic ,assign) int index;
/// 模板任务类型详情
@property (nonatomic ,strong) NSMutableArray<TemplateFoundDetailsTaskTypeModelListModel *> * taskTypeModelList;
///模版名称长度加图标
@property (nonatomic ,assign) CGFloat nameW;
///额外
///是否选中状态
@property (nonatomic ,assign) NSInteger isSeled;

///判断同类型任务排序
- (int)ItemModelListIndexWithmodel:(TemplateFoundDetailsTaskTypeModelListModel *)model;
///提交时的提示文本
- (NSString *)TjAPiHUDString;

///提交字典
- (NSMutableDictionary *)TjDictWithNew:(BOOL)isNew;
- (NSMutableDictionary *)TjDictWithXG:(BOOL)isNew;


@end



///具体任务快
@interface TemplateFoundDetailsTaskTypeModelListModel : NSObject

///任务指派人id;逗号分割
@property (nonatomic ,strong) NSString * appointorId;
///任务指派人;逗号分割
@property (nonatomic ,strong) NSString * appointorName;
///任务指派人数数租
@property (nonatomic ,strong) NSMutableArray <PondUserModel *>* appointorArray;

///取消下发结束时间
@property (nonatomic ,strong) NSString * cancelEndDay;
///取消下发开始时间
@property (nonatomic ,strong) NSString * cancelStartDay;

///任务说明
@property (nonatomic ,strong) NSString * Description;
///公共模板任务类型id用来比对任务
@property (nonatomic ,strong) NSString * commonId;

///执行天数类型:1:自定义天数 2:整个养殖周期
@property (nonatomic ,assign) NSInteger executeType;
///任务类型:1:标准设置 2:自定义设置
@property (nonatomic ,assign) NSInteger taskType;
///主键
@property (nonatomic ,strong) NSString * ID;
///任务步骤
@property (nonatomic ,strong) NSString * name;
@property (nonatomic ,strong) NSAttributedString * nameStr;
///起始天数
@property (nonatomic ,assign) NSInteger startDay;
///结束天数
@property (nonatomic ,assign) NSInteger endDay;
///模板频率(天)
@property (nonatomic ,assign) NSInteger rateDay;
///模板频率(次)
@property (nonatomic ,assign) NSInteger rateNumber;
///指导视频
@property (nonatomic ,strong) NSString * videoUrl;
///模板任务类型id;用于比较模板任务类型,不可删除
@property (nonatomic ,strong) NSString * templateTasktypeId;
///排序
@property (nonatomic ,assign) NSInteger sort;
///任务所属:1:投苗任务 2:巡检任务 3:水质检测任务 4:出塘任务 5:其他任务
@property (nonatomic ,assign) NSInteger sortOut;
///模板执行时间详情
@property (nonatomic ,strong) NSMutableArray<TemplateFoundDetailsExecuteModelListModel *> * executeModelList;
///模板任务项详情
@property (nonatomic ,strong) NSMutableArray<TemplateFoundDetailsTaskItemModelListModel *> * taskItemModelList;
///有下级的任务项
@property (nonatomic ,strong) TemplateFoundDetailsTaskItemModelListModel * XJtaskItemModel;

///额外数据
@property (nonatomic ,assign) CGFloat haederViewH;
@property (nonatomic ,assign) CGFloat footerViewH;
///执行时间高度 53一个基数
@property (nonatomic ,assign) CGFloat rateTimeViewH;
///是否是收起状态
@property (nonatomic ,assign) BOOL isSQ;
///是否来自于模板: 1是 0否
@property (nonatomic ,assign) NSInteger sourceFlag;
///新增时使用的任务名称
@property (nonatomic ,strong) NSString * sortName;

///时间模块排序
- (void)TimeArrayReload;
///提交时的提示文本
- (NSString *)TjAPiHUDString;

- (NSMutableDictionary *)TjDictWithNew:(BOOL)isNew;
- (NSMutableDictionary *)TjDictWithXG:(BOOL)isNew;

///新增任务使用
///配置选项:0:默认,无需配置 1:统一配置 2:分别配置
@property (nonatomic ,assign) int configureItem;
///任务执行时间(不从模板获取)
@property (nonatomic ,strong) NSString * executeTime;
///任务选择池塘列表
@property (nonatomic ,strong) NSMutableArray<pondModelListModel *> * pondModelListModel;

//用来拷贝的池塘列表
@property (nonatomic ,strong) NSMutableArray<pondModelListModel *> * CopyPondModelListModel;
///用来拷贝的任务模块
@property (nonatomic ,strong) NSMutableArray<TemplateFoundDetailsTaskItemModelListModel *> * CopyTaskItemModelList;

///新增任务时的haederViewH
@property (nonatomic ,assign) CGFloat RWhaederViewH;
@property (nonatomic ,assign) CGFloat RWfooterViewH;
///是否按照表格显示
@property (nonatomic ,assign) BOOL isBG;

- (NSString *)TjRWAPiHUDString;
- (NSMutableDictionary *)TjRWDict;

///所有池塘添加任务
- (void)AllPondAddTask;

@end



///模板执行时间详情
@interface TemplateFoundDetailsExecuteModelListModel : NSObject
///模板执行时间
@property (nonatomic ,strong) NSString * executeTime;
///数字化时间
@property (nonatomic ,assign) int IntExecuteTime;
///主键
@property (nonatomic ,strong) NSString * ID;
///模板任务时间id;用于比较模板任务类型,不可删除
@property (nonatomic ,strong) NSString * templateExecuteId;

- (NSMutableDictionary *)TjDictWithNew:(BOOL)isNew;
@end


///模板任务项详情
@interface TemplateFoundDetailsTaskItemModelListModel : NSObject

///    是否可添加子任务项 1:是 0:否
@property (nonatomic ,assign) NSInteger childrenFlag;
///模范文本
@property (nonatomic ,strong) NSString * content;
///精度
@property (nonatomic ,assign) NSInteger degree;
/// 是否必填;1:允许 0:不允许
@property (nonatomic ,assign) NSInteger forceFlag;
///主键
@property (nonatomic ,strong) NSString * ID;
///模板任务时间id;用于比较模板任务类型,不可删除
@property (nonatomic ,strong) NSString * templateExecuteId;
///标题
@property (nonatomic ,strong) NSString * name;
/// 默认数值
@property (nonatomic ,strong) NSNumber * number;
@property (nonatomic ,strong) NSString * numberStr;
///单位数值
@property (nonatomic ,strong) NSString * unitName;
/// 最大值
@property (nonatomic ,assign) NSInteger numberMax;
/// 最小值
@property (nonatomic ,assign) NSInteger numberMin;
/// 样式;1:多项选择 2:下单单选3:数字输入框4:单行文本 5:多行文本
@property (nonatomic ,assign) NSInteger pattern;
/// 排序
@property (nonatomic ,assign) NSInteger sort;
///          步进值
@property (nonatomic ,assign) CGFloat stepValue;

/// 模板任务项id
@property (nonatomic ,strong) NSString * templateTaskitemId;

///模板多选项配置id
@property (nonatomic ,strong) NSString * templateItemId;

///子任务项详情---好像用不到
@property (nonatomic ,strong) NSMutableArray<TemplateFoundDetailsChildrenModelListModel *> * childrenModelList;

///选项配置内容详情
@property (nonatomic ,strong) NSMutableArray<TemplateFoundDetailsItemModelListModel *> * itemModelList;

///额外数据
@property (nonatomic ,assign) CGFloat CellH;

///打开时cell高度,是多选时有额外空间
@property (nonatomic ,assign) CGFloat DKCellH;
///新增任务时多选选择是view的高度
@property (nonatomic ,assign) CGFloat RWDXXZViewH;
///鱼塘打卡view高度
@property (nonatomic ,assign) CGFloat DKDXXZViewH;

///鱼塘统一打卡view高度
@property (nonatomic ,assign) CGFloat TYDKDXXZViewH;

///打卡多任务多鱼塘的cell高度
@property (nonatomic ,assign) CGFloat DKDRWDYTCellH;
///打卡多任务多鱼塘view的高度
@property (nonatomic ,assign) CGFloat DKDRWDYTViewH;
///打卡多任务鱼塘view是否收起
@property (nonatomic ,assign) BOOL isDRWSQ;

@property (nonatomic ,strong) NSMutableArray<pondModelListModel *> * pondModelList;

///单选下拉时选中的model
@property (nonatomic ,strong) TemplateFoundDetailsItemModelListModel * itemSeledModel;
///获取鱼塘下指定的任务model
- (TemplateFoundDetailsTaskItemModelListModel *)modelWithPondModel:(pondModelListModel *)model;

///提交时的提示文本
- (NSString *)TjAPiHUDString;

- (NSMutableDictionary *)TjDictWithNew:(BOOL)isNew;
- (NSMutableDictionary *)TjDictWithXG:(BOOL)isNew;

- (NSMutableDictionary *)TjRWDictWithNew;

///配置选项:0:默认,无需配置 1:统一配置 2:分别配置---打卡时使用
@property (nonatomic ,assign) int configureItem;


///日志时又子集的列表
@property (nonatomic ,strong) NSMutableArray<TemplateFoundDetailsItemModelListModel *> * SubsetitemModelList;

///日志时没有子集的列表
@property (nonatomic ,strong) NSMutableArray<TemplateFoundDetailsItemModelListModel *> * SubsetNoitemModelList;
@property (nonatomic ,strong) NSString * SubsetNoitemModelListStr;

@end
///子任务项详情
@interface TemplateFoundDetailsChildrenModelListModel : NSObject

///主键
@property (nonatomic ,strong) NSString * ID;
///标题
@property (nonatomic ,strong) NSString * name;
///模板多选项配置id
@property (nonatomic ,strong) NSString * templateItemId;

///单位数值
@property (nonatomic ,strong) NSString * unitName;
///排序
@property (nonatomic ,assign) NSInteger sort;
///选项标签;1:是 0:否
@property (nonatomic ,assign) NSInteger checkedFlag;
@property (nonatomic ,assign) CGFloat nameW;
- (NSMutableDictionary *)TjDictWithNew:(BOOL)isNew;
- (NSMutableDictionary *)TjDictWithXG:(BOOL)isNew;


@end
///选项配置内容详情
@interface TemplateFoundDetailsItemModelListModel : NSObject

///主键
@property (nonatomic ,strong) NSString * ID;
///标题
@property (nonatomic ,strong) NSString * name;
///排序
@property (nonatomic ,assign) NSInteger sort;

///选项标签;1:是 0:否
@property (nonatomic ,assign) NSInteger checkedFlag;
///模板多选项配置id
@property (nonatomic ,strong) NSString * templateItemId;

///下拉选项配置详情
@property (nonatomic ,strong) NSMutableArray<TemplateFoundDetailsItemListModel *> * itemList;

///单位数值
@property (nonatomic ,strong) NSString * unitName;
///额外数据
@property (nonatomic ,assign) CGFloat nameW;
///打卡是,多任务的view高度
@property (nonatomic ,assign) CGFloat itemListViewH;

///是否是收起状态
@property (nonatomic ,assign) BOOL isSQ;

- (NSMutableDictionary *)TjDictWithNew:(BOOL)isNew;
- (NSMutableDictionary *)TjDictWithXG:(BOOL)isNew;

@end
///下拉选项配置详情
@interface TemplateFoundDetailsItemListModel : NSObject

///主键
@property (nonatomic ,strong) NSString * ID;
///标题
@property (nonatomic ,strong) NSString * name;
///排序
@property (nonatomic ,assign) NSInteger sort;
///选项标签;1:是 0:否
@property (nonatomic ,assign) NSInteger checkedFlag;
///    是否可添加子任务项 1:是 0:否
@property (nonatomic ,assign) NSInteger childrenFlag;
/// 默认数值
@property (nonatomic ,strong) NSNumber * number;
@property (nonatomic ,strong) NSString * numberStr;

///单位数值
@property (nonatomic ,strong) NSString * unitName;
/// 最大值
@property (nonatomic ,assign) NSInteger numberMax;
/// 最小值
@property (nonatomic ,assign) NSInteger numberMin;
/// 样式;1:多项选择 2:下单单选3:数字输入框4:单行文本 5:多行文本
@property (nonatomic ,assign) NSInteger pattern;
/// 步进值
@property (nonatomic ,assign) CGFloat stepValue;
///精度
@property (nonatomic ,assign) NSInteger degree;
///模范文本
@property (nonatomic ,strong) NSString * content;
/// 是否必填;1:允许 0:不允许
@property (nonatomic ,assign) NSInteger forceFlag;
/// 模板任务项id
@property (nonatomic ,strong) NSString * templateTaskitemId;
/// 模板多选项配置id
@property (nonatomic ,strong) NSString * templateItemId;
///子任务项详情
@property (nonatomic ,strong) NSMutableArray<TemplateFoundDetailsChildrenModelListModel *> * childrenModelList;
@property (nonatomic ,strong) TemplateFoundDetailsChildrenModelListModel * seledModel;



///使用的描述文本
@property (nonatomic ,strong) NSString * contentStr;
///额外数据
///打卡任务view高度
@property (nonatomic ,assign) CGFloat viewH;
- (NSMutableDictionary *)TjDictWithNew:(BOOL)isNew;
- (NSMutableDictionary *)TjDictWithXG:(BOOL)isNew;

@end
NS_ASSUME_NONNULL_END
